//
//  HotDetailDownTableViewCell.m
//  礼物go
//
//  Created by dllo on 16/5/23.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "HotDetailDownTableViewCell.h"
#import "HotColumnCell.h"

#define MARGINSPACE 10
#define ITEMHEIGHT 260


@interface HotDetailDownTableViewCell ()<UIWebViewDelegate>


@end

@implementation HotDetailDownTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}

-(void)createSubviews{
    self.webView = [[UIWebView alloc] initWithFrame:self.contentView.bounds];
    [self.contentView addSubview:self.webView];
    self.webView.delegate = self;
    self.webView.scrollView.bounces = NO;
    self.webView.scrollView.scrollEnabled = NO;
    
}


-(void)setHotDetailM:(HotDetailModel *)hotDetailM{
    _hotDetailM = hotDetailM;
    
    [self.webView loadHTMLString:_hotDetailM.detail_html baseURL:nil];
}

-(void)webViewDidFinishLoad:(UIWebView *)webView{
CGFloat htmlHeight = [[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.scrollHeight"] floatValue];
  self.webView.frame = CGRectMake(0, 0, SCREENWIDTH, htmlHeight);
//    self.hotDetailM.height = htmlHeight;
  
    self.webBlockHeight(htmlHeight);
    
    
//    self.hotTableView.rowHeight = htmlHeight;
    
    // NSLog(@"11111111111111111111111111111");
 }





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
